global soal1 soal2
global numsoal
global x0 xn h n y01 y02 numy0
global fungsi1 fungsi2
global numfungsi
global metodestring
global hasil1 hasil2 
global numhasil

x = [0 2];
h = [0.2 0.1 0.05];
y0 = 0.1;
y_absen = @(x,y)(exp(-2*x)-2*y);
orde = [ 3 4 ];

% Orde 3, h = 0.2
[n result1] = Runge_Kutta( x, h(1), y0, y_absen, orde(1));
% Orde 3, h = 0.1
[n result2] = Runge_Kutta( x, h(2), y0, y_absen, orde(1));
% Orde 3, h = 0.05
[n result3] = Runge_Kutta( x, h(3), y0, y_absen, orde(1));

% Orde 4, h = 0.2
[n result4] = Runge_Kutta( x, h(1), y0, y_absen, orde(2));
% Orde 4, h = 0.1
[n result5] = Runge_Kutta( x, h(2), y0, y_absen, orde(2));
% Orde 4, h = 0.05
[n result6] = Runge_Kutta( x, h(3), y0, y_absen, orde(2));

result = [result1 result2 result3 result4 result5 result6];

clear result1 result2 result3 result4 result5 result6;

%------------------------------------------------%
% Pembuatan report
%------------------------------------------------%
% Soal
soal1 = 'y'' = exp(-2*t) - 2*y';
numsoal = 1;
% Variabel
x0 = x(1); xn = x(2);
h = h(1); % h = 0.2; h bisa diganti-ganti
% n = n (variabel dan globalnya sama)
y01 = y0;
numy0 = 1;
% Fungsi untuk perhitungan
fungsi1 = func2str(y_absen);
numfungsi = 1;
% Metode
metodestring = 'Runge-Kutta Orde 3';
% Hasil
hasil1 = result(1);
numhasil = 1;
% Generate Report
report('DifferentialEquation');
